|  ChatParse.inc for AFCleric by Fantum409 

Sub ChatParse(string ChatType,string Sender,string ChatText) 
   /e ChatType<${ChatType}>, Sender<${Sender}>, ChatText<${ChatText}> 
   /if (${ChatText.Equal[rezzme]}) { 
      /keypress back 
      /target ${Sender}'s Corpse 
      /delay 3 
      /if (${Target.Type.Equal[corpse]}) { 
         /corpse 
         /delay 3 
         /corpse 
         /call Cast "Water Sprinkler of Nem Ankh" item 
      } 
   } 
   /if (${Sender.Equal[${Me}]}) /return 
   /if (!${Spawn[${Sender}].ID}) { 
      /e ${Sender} is not in the zone 
      /return 
   } 
   /if ((${ChatText.Equal[Follow me]})&&(${Sender.NotEqual[${Me}]})) { 
      /delay 5 
      /if (!${Spawn[${Sender}].ID}) { 
         /e ${Sender} is not in zone for me to follow! 
         /return 
      } 
      /varset follname ${Sender} 
      /varset following 1 
      :targetfoll 
      /target pc ${follname} 
      /delay 1s ${Target.Name.Equal[${follname}]} 
      /if (${Target.Name.Equal[${follname}]}) { 
         /goto :Loop 
      } else /goto :targetfoll 
      :Loop 
      /face fast 
      /if (${Target.Distance}>10) /keypress forward hold 
      /if (${Target.Distance}<9) /keypress back 
      /if (!${Target.ID}) /varset following 0 
      /call CheckEvents 
      /if ((${Target.Name.Equal[${follname}]})&&(${following}>0)) { 
         /goto :Loop 
      } else { 
         /keypress forward 
         /keypress back 
      } 
   } 
   /if (${ChatText.Equal[End follow]}) { 
      /varset following 0 
      /keypress forward 
      /keypress back 
      /timed 50 /face pc ${follname} 
   } 
   /if (${ChatText.Equal[Gbuff now!]}) { 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
      /varset pallycount 0 
      /target myself 
      /if (${groupspellhastebuff.NotEqual[NULL]}) /call Cast "${groupspellhastebuff}" gem8 5s 
      /call Cast "${acbuff}" gem6 7s 
      /if (${groupspellhastebuff.Equal[NULL]}) { 
         /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item 
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s 
      } 
      /for gmember 1 to ${Group} 
         /target id ${Group.Member[${gmember}].ID} 
         /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID} 
         /if (${Target.ID}==${Group.Member[${gmember}].ID}) { 
            /if (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${acbuff}" gem5 7s 
            /if (${Target.Class.Name.Equal[Paladin]}) { 
               /call Cast "${longhpbuff}" gem5 10s 
               /varcalc pallycount ${pallycount}+1 
            } 
            /if (${groupspellhastebuff.Equal[NULL]}) /if ((${Target.Class.Name.NotEqual[Warrior]})&&(${Target.Class.Name.NotEqual[Monk]})&&(${Target.Class.Name.NotEqual[Rogue]})&&(${Target.Class.Name.NotEqual[Berserker]})&&(${Target.Class.Name.NotEqual[Bard]})) { 
               /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item 
               /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s 
            } 
         } 
      /next gmember 
      /if ((${Math.Calc[${Group}-${pallycount}]}>=2)&&(${groupsymbuff.NotEqual[NULL]})) /call Cast "${groupsymbuff}" gem5 10s 
      /if ((${Math.Calc[${Group}-${pallycount}]}<2)||(${groupsymbuff.Equal[NULL]})) { 
         /for gmember 0 to ${Group} 
            /target id ${Group.Member[${gmember}].ID} 
            /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID} 
            /if (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${singlesymbuff}" gem5 7s 
         /next gmember 
      } 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
   }    
   /if (${ChatText.Equal[BoR now!]}) { 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
      /target myself 
      /delay 5 ${Target.Name.Equal[${Me}]} 
      /if (${groupspellhastebuff.Equal[NULL]}) { 
         /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item 
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s 
         /for gmember 1 to ${Group} 
            /target id ${Group.Member[${gmember}].ID} 
            /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID} 
            /if (${Target.ID}==${Group.Member[${gmember}].ID}) { 
               /if ((${Target.Class.Name.NotEqual[Warrior]})&&(${Target.Class.Name.NotEqual[Monk]})&&(${Target.Class.Name.NotEqual[Rogue]})&&(${Target.Class.Name.NotEqual[Berserker]})&&(${Target.Class.Name.NotEqual[Bard]})) { 
                  /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item 
                  /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s 
               } 
            } 
         /next gmember 
      } 
      /if (${groupspellhastebuff.NotEqual[NULL]}) /call Cast "${groupspellhastebuff}" gem8 5s 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
   }    
   /if (${ChatText.Equal[nuke]}) { 
      /if (${Me.PctMana}<30) { 
         /if (${usegroupchat}==0) /i say Cleric Mana ${Me.PctMana}%, holding on nukes! 
         /if (${usegroupchat}==1) /g Cleric Mana ${Me.PctMana}%, holding on nukes! 
      } else { 
         /assist ${Sender} 
         /delay 5 
         /if (${Target.Type.NotEqual[NPC]}) { 
            /assist ${Sender} 
            /delay 5 ${Target.Type.Equal[NPC]} 
         } 
         /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) { 
            /if (${Me.SpellReady[${nukeone}]}) { 
               /if (${announce}==1) /g Casting ${nukeone} on %T 
               /call Cast "${nukeone}" spell 3s 
            } else /if (${Me.SpellReady[${nuketwo}]}) { 
               /if (${announce}==1) /g Casting ${nuketwo} on %T 
               /call Cast "${nuketwo}" spell 3s 
            } else { 
               /if (${usegroupchat}==0) /i say nukes not ready 
               /if (${usegroupchat}==1) /g nukes not ready 
            } 
            /if (${Me.PctMana}<=60) { 
               /if (${usegroupchat}==0) /i say FYI Cleric Mana ${Me.PctMana}% 
               /if (${usegroupchat}==1) /g FYI Cleric Mana ${Me.PctMana}% 
            } 
         } else { 
            /if (${usegroupchat}==0) /i say wrong target (${Target.Type} at ${Target.PctHPs}% HP) 
            /if (${usegroupchat}==1) /g wrong target (${Target.Type} at ${Target.PctHPs}% HP) 
         } 
      } 
   } 
   /if (${ChatText.Equal[stun]}) { 
      /assist ${Sender} 
      /delay 5 
      /if (${Target.Type.NotEqual[NPC]}) { 
         /assist ${Sender} 
         /delay 5 ${Target.Type.Equal[NPC]} 
      } 
      /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) { 
         /if (${Me.SpellReady[${stunone}]}) { 
            /if (${announce}==1) /g Casting ${stunone} on %T 
            /call Cast "${stunone}" spell 3s 
         } else /if (${Me.SpellReady[${stuntwo}]}) { 
            /if (${announce}==1) /g Casting ${stuntwo} on %T 
            /call Cast "${stuntwo}" spell 3s 
         } else { 
            /if (${usegroupchat}==0) /i say stuns not ready 
            /if (${usegroupchat}==1) /g stuns not ready 
         } 
      } else { 
         /if (${usegroupchat}==0) /i say wrong target (${Target.Type} at ${Target.PctHPs}% HP) 
         /if (${usegroupchat}==1) /g wrong target (${Target.Type} at ${Target.PctHPs}% HP) 
      } 
   } 
   /if (${ChatText.Equal[buffme]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
      /if (${Target.Class.Name.Equal[Paladin]}) { 
         /call Cast "${longhpbuff}" gem5 10s 
         /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item 
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s 
         /return 
      } 
      /if ((${Target.Class.Name.NotEqual[Warrior]})&&(${Target.Class.Name.NotEqual[Monk]})&&(${Target.Class.Name.NotEqual[Rogue]})&&(${Target.Class.Name.NotEqual[Berserker]})&&(${Target.Class.Name.NotEqual[Bard]})) { 
         /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item 
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s 
      } 
      /call Cast "${acbuff}" gem6 7s 
      /call Cast "${singlesymbuff}" gem5 7s 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
   } 
   /if (${ChatText.Equal[sym]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
      /call Cast "${singlesymbuff}" gem5 7s 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
   } 
   /if (${ChatText.Equal[wog]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
      /call Cast "${acbuff}" gem6 7s 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
   } 
   /if ((${ChatText.Equal[V]})||(${ChatText.Equal[conv]})) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
      /call Cast "${longhpbuff}" gem5 10s 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
   } 
   /if (${ChatText.Equal[bor]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
      /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item 
      /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
   } 
   /if (${ChatText.Equal[rgc]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${FindItem[Blackflame Sphere].ID}) { 
         /call Cast "Blackflame Sphere" item 
      } else /if (${FindItem[Wand of Casual Blessings].ID}) { 
         /call Cast "Wand of Casual Blessings" item 
      } else /call Cast "${rgcspell}" gem8 5s 
   } 
   /if (${ChatText.Equal[di]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
      /call Cast "Divine Intervention" gem8 3s 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
   } 
   /if (${ChatText.Equal[vie]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
      /call Cast "Panoply of Vie" gem6 5s 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
   } 
   /if (${ChatText.Equal[pb]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /call Cast "Pure Blood" gem6 10s 
   } 
   /if (${ChatText.Equal[hot me]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${Target.Distance}<=${hotspellrange}) { 
         /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
         /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
         /if (${announce}==1) /g Casting ${hotspell} on %T 
         /call Cast "${hotspell}" gem2 2s 
         /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
         /delay 15 ${Me.SpellReady[${hotspell}]} 
      } else /tell ${Sender} your OOR 
   } 
   /if (${ChatText.Equal[ch me]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${Target.Distance}<=100) { 
         /if (${announce}==1) /g Casting Complete Healing on %T 
         /call Cast "Complete Healing" gem2 5s 
         /delay 15 ${Me.SpellReady[${hotspell}]} 
      } else /tell ${Sender} your OOR 
   } 
   /if ((${ChatText.Equal[patch me]})||(${ChatText.Equal[heal]})||(${ChatText.Equal[heal me]})||(${ChatText.Equal[heal plz]})||(${ChatText.Equal[heal me plz]})||(${ChatText.Equal[need heal]})) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${Target.Distance}<=${patchhealrange}) { 
         /if (${announce}==1) /g Casting ${patchheal} on %T 
         /call Cast "${patchheal}" gem2 2s 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
      } else /tell ${Sender} your OOR 
   } 
   /if (${ChatText.Equal[buff pet]}) { 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 8 
      /target ${Spawn[pc ${Sender}].Pet} 
      /call Cast "${acbuff}" gem6 7s 
      /call Cast "${singlesymbuff}" gem5 7s 
      /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
   } 
   /if (${ChatText.Equal[da pet]}) { 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 6 
      /target ${Spawn[pc ${Sender}].Pet} 
      /if (${Me.AltAbilityReady[39]}) /if (${Target.Name.Equal[${Spawn[pc ${Sender}].Pet.Name}]}) { 
         /call Cast "39" alt 
      } else { 
         /if (${usegroupchat}==0) /i say Bestow Divine Aura is not ready, or Target (%T) OOR or wrong target 
         /if (${usegroupchat}==1) /g Bestow Divine Aura is not ready, or Target (%T) OOR or wrong target 
      } 
   } 
   /if (${ChatText.Equal[hot pet]}) { 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 6 
      /target ${Spawn[pc ${Sender}].Pet} 
      /if (${Target.Name.Equal[${Spawn[pc ${Sender}].Pet.Name}]}) { 
         /if (${Target.Distance}<=${hotspellrange}) { 
       /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem "${edbuffitem}" 
       /if (${edbuffItem.Name.NotEqual[NULL]}) /varset olditem ${Macro.Return} 
       /if (${announce}==1) /g Casting ${hotspell} on %T 
       /call Cast "${hotspell}" gem2 2s 
       /if (${edbuffItem.Name.NotEqual[NULL]}) /call EquipItem ${olditem} 
       /delay 15 ${Me.SpellReady[${hotspell}]} 
         } else /tell ${Sender} your pet is OOR 
      } 
   } 
   /if (${ChatText.Equal[mana check]}) { 
      /if (${usegroupchat}==0) /i say Cleric Mana ${Me.PctMana}% 
      /if (${usegroupchat}==1) /g Cleric Mana ${Me.PctMana}% 
   } 
   /if (${ChatText.Equal[manapoll]}) { 
      /if (${usegroupchat}==0) /i say ${Me.PctMana}% 
      /if (${usegroupchat}==1) /g ${Me.PctMana}% 
   } 
   /if (${ChatText.Equal[slowcamp]}) { 
      /if (${Me.Standing}) /sit 
      /delay 5m ${Me.PctMana}>=98 
      /camp 
      /end 
   } 
   /if (${ChatText.Equal[AE-time]}) { 
      /varset aetime 1 
      /if (${usegroupchat}==0) /i say AE activated! 
      /if (${usegroupchat}==1) /g AE activated! 
      :aeloop 
      /if (${NearestSpawn[4, npc].Distance}<35) { 
         /if (${Me.SpellReady[Catastrophe]}) /call Cast "Catastrophe" spell 3s 
         /if (${Me.SpellReady[Upheaval]}) /call Cast "Upheaval" spell 3s 
         /if (${Me.SpellReady[The Unspoken Word]}) /call Cast "The Unspoken Word" spell 3s 
      } 
      /call CheckEvents 
      /if (${Me.PctHPs}<60) { 
         /varset aetime 0 
         /if (${usegroupchat}==0) /i say Stopping AE due to low HP 
         /if (${usegroupchat}==1) /g Stopping AE due to low HP 
      } 
      /if (${NearestSpawn[4, npc].Distance}>100) { 
         /varset aetime 0 
         /if (${usegroupchat}==0) /i say Stopping AE since not enough mobs in range 
         /if (${usegroupchat}==1) /g Stopping AE since not enough mobs in range 
      } 
      /if (${aetime}==1) /goto :aeloop 
   } 
   /if (${ChatText.Equal[stop AE]}) { 
      /varset aetime 0 
      /if (${usegroupchat}==0) /i say AE DE-activated 
      /if (${usegroupchat}==1) /g AE DE-activated 
   } 
   /if (${ChatText.Equal[manastone time]}) { 
      /varset manastonecycle 1 
      /call EquipItem "Manastone|mainhand" 
      /varset oldprimary ${Macro.Return} 
      :manastoneuse 
      /if ((${Me.PctHPs}>=50)&&(${Me.PctMana}<=98)&&(${manastonecycle}==1)) { 
         /call Cast "Manastone" item 
         /call Cast "Manastone" item 
         /call Cast "Manastone" item 
      } 
      /delay 1 
      /doevents 
      /if (${manastonecycle}==1) /goto :manastoneuse 
      /call EquipItem ${oldprimary} 
   } 
   /if (${ChatText.Equal[manastone stop]}) { 
      /varset manastonecycle 0 
      /return 
   } 
   /if (${ChatText.Equal[rc]}) { 
      /if (${Me.AltAbilityReady[390]}) /call Cast "390" alt 
   } 
   /if (${ChatText.Equal[silence fewls]}) { 
      /varset announce 0 
   } 
   /if (${ChatText.Equal[speak up]}) { 
      /varset announce 1 
   } 
/return